package com.springcloud.authentication.modules.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.springcloud.authentication.modules.entity.SysRole;
import com.springcloud.authentication.modules.entity.SysUser;


/**
 * JPQL、HQL、原生sql 都是支持的
 * @author Administrator
 *
 */
public interface RoleRepository  extends JpaRepository<SysRole, Integer>{

	
	@Query(nativeQuery=true,value="select a.id,a.name from sys_role a,sys_role_user b where b.sys_role_id = a.id and  b.sys_user_id = ?1")
	List<SysRole> findUserRoleList(String userId);
	
	
	
}